package Day08_18;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Logger {
        public static void setLog(String args){
            try {
                PrintStream ps = new PrintStream(new FileOutputStream( "log"));
                System.setOut(ps);
                Date date = new Date();
                SimpleDateFormat sdf = new SimpleDateFormat();
                System.out.println(args +"  " + sdf.format(date));

            } catch (FileNotFoundException e) {
                throw new RuntimeException(e);
            }
        }

}
